package com.fqgj.sentry.common.enums;

import java.util.Objects;

/**
 * Created by ykpbean kangping.ying@yuntu-inc.com
 *
 * @description
 * @create 2017-08-29 上午10:05
 */
public enum RiskResultEnums {

    reject(1, "拒绝"),
    review(2, "人工"),
    pass(3, "通过");

    private Integer resultType;
    private String desc;

    RiskResultEnums(Integer resultType, String desc) {
        this.resultType = resultType;
        this.desc = desc;
    }

    public Integer getResultType() {
        return resultType;
    }

    public RiskResultEnums setResultType(Integer resultType) {
        this.resultType = resultType;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public RiskResultEnums setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static RiskResultEnums getByValue(Integer resultType) {
        for (RiskResultEnums riskResultEnums : RiskResultEnums.values()) {
            if (Objects.equals(resultType, riskResultEnums.getResultType())) {
                return riskResultEnums;
            }
        }
        return null;
    }
}
